# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Cedric Girard <girard.cedric@gmail.com>

_pkgname=contextlib2
pkgname=python-$_pkgname
pkgver=21.6.0
pkgrel=2
pkgdesc="Backport of the standard library's contextlib module to earlier Python versions"
arch=('any')
url='https://github.com/jazzband/contextlib2'
license=('PSF')
depends=('python')
makedepends=('python-setuptools')
source=("$pkgname-$pkgver::$url/archive/$pkgver.tar.gz")
sha512sums=('60bdee16ac14612bfd3986ee06a42f74653fc07d5c2da6f00e1bf552c75372f6ed3fd0e313e929e20d9d9efe8c48320d59ac2ae680ebc83efef413ea82776c9b')

build() {
  echo "Building python-$_pkgname $pkgver"
  cd "$srcdir"/$_pkgname-$pkgver
  python setup.py build
}

package() {
  cd $_pkgname-$pkgver

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
